
<%@page import="cn.com.dhcc.app.core.CoreEnv.CoreInitCtx"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>

<script type="text/javaScript" src="${ctx}/static/js/jquery.selectlistactions.js"></script>
<!-- 必要的js文件 end -->
<script type="text/javascript">
	var recvSysCodes = "";
	var num = 0;
	var auditorFlag = false;
	var modal = null;
	var tableInfoModal = null;
	var whereConditionModal = null;
	var tabs = [];
	var tabList = [];
	var tableNames="";
	var tablesJson;
	var auditorFlag=0;
	var flag = false;
	var isExit=true;
	var userTablesName = "";
	var uploaderModal=null;

    var mptype = ${dm.mappingType};
    $(document).ready(function() {
        $("#conf_1").css("display", "none");
        $("#conf_3").css("display", "none");
        $("#conf_" + mptype).css("display", "");
    });
	function showColInfo(obj) {
		var id = $(obj).attr("tableId");
		$.ajax({
			type : "POST",
			dataType : "html",
			cache : false,
			url : _ctx + "/task/get_table_col.do",
			data : {
				tableId : id,
			},
			success : function(content) {
				$("#tableDiv").html(content);
				var hiddenByClick = false;
			    window.parent.iframeModal("tableModal", $("#tempDiv").html(), hiddenByClick);
			},
			error : function() {
				ui.msg('信息加载错误', 0);
			}
		}); 
	}
</script>
</head>
<body >
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<div class="main-content" style="margin-left: 0px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> 首页</li>
						<li>查看任务</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<div class="widget-main">
								<div class="widget-box">
									<div class="widget-header widget-header-flat">
										<div class="widget-toolbar no-border">
											<a class="btn btn-primary btn-xs"
												href="${ctx}/task/task_list.do"><i
												class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
										</div>
									</div>
									<form class="form-horizontal" role="form" id="inputForm" action="" method="post">
										<div class="row">
											<div class="col-sm-12">
												<h6 class="header smaller lighter blue">
													&nbsp;&nbsp;路由设置</h6>
											</div>
										</div>
										<div class="row">
											<div class="table-responsive">
												<div class="row">
													<div class="col-xs-12">
														<div class="widget-main">
															<div class="profile-user-info profile-user-info-striped" id="taskInfo">
																<div class="profile-info-row" style="height: 45px;">
																	<div class="profile-info-name"style="padding-top: 15px;">
																		任务名称
																	</div>
																	<div class="profile-info-value" style="padding-top: 15px;">
																		<span class="editable" > 
																		<b>	${vo.taskName }</b>
																			<span class="lbl">&nbsp;</span> 
																		</span>
																	</div>
																</div>
																<div class="profile-info-row" style="height: 45px;">
																	<div class="profile-info-name"
																		style="padding-top: 15px;">所属数据分类</div>
																	<div class="profile-info-value" style="padding-top: 15px;">
																		<span class="editable" > 
																		<b>	${dc.name }</b>
																			<span class="lbl">&nbsp;</span> 
																		</span>
																	</div>
																</div>
																<div class="profile-info-row" style="height: 45px;">
																	<div class="profile-info-name" style="padding-top: 15px;">选择数据源映射</div>
																	<div class="profile-info-value" style="padding-top: 15px;">
																		<span class="editable" > 
																		<b>	${dm.mappingName }</b>
																			<span class="lbl">&nbsp;</span> 
																		</span>
																	</div>
																</div>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
										
										<div class="row">
											<div class="col-sm-12">
												<h6 class="header smaller lighter blue">
													&nbsp;&nbsp;数据抽取配置</h6>
											</div>
										</div>

										<div class="row" id="conf_1" style="display: none;">
											<div class="col-xs-12">
												<table class="table table-striped table-bordered table-hover">
													<thead>
														<tr>
															<th class="center" >已选择表</th>	
															<th class="center" >有增量字段</th>	
															<th class="center" >字段信息</th>
															<th class="center" >抽取开始值</th>
															<th class="center" >抽取结束值</th>
															<th class="center" >自定义过滤条件</th>
														</tr>
													</thead>
													<tbody id="table_table_body">
														<c:forEach var="table" items="${tables}" varStatus="stc">
															<tr>
		    													<td class="center">${table.tableName}</td>
		    													<td class="center">
		    														<c:if test="${table.tableType == '1'}">有</c:if>
		    														<c:if test="${table.tableType == '0'}">无</c:if>
		    													</td>
		    													<td class="center">
			      													<button tableId='${table.tableId}' type='button' class='btn btn-xs btn-info' onclick='showColInfo(this)' >查看</button>
			      												</td>
			      												<td>${table.startValue}</td>
			      												<td>${table.endValue}</td>		
			      												<td class="center">
			      													${table.whereCondition}
			      												</td>
		  													</tr>
		  													
	  													</c:forEach>
													</tbody>
												</table>
											</div>
										</div>
										<div class="row" id="conf_3" style="display: none;">
                                            <div class="table-responsive">
                                                <div class="row">
                                                    <div class="col-xs-12">
                                                        <div class="widget-main">
                                                            <div class="profile-user-info profile-user-info-striped">
                                                                <div class="profile-info-row">
                                                                    <div class="profile-info-name">目录过滤条件</div>
                                                                    <div class="profile-info-value">
																		<span class="editable">
																			<c:if test="${filter.chlidDir eq 1}">
                                                                                <span class="lbl"> 发送子目录</span>
                                                                            </c:if>
																			<c:if test="${filter.chlidDir ne 1}">
                                                                                <span class="lbl">无</span>
                                                                            </c:if>
																		</span>
                                                                    </div>
                                                                </div>
                                                                <div class="profile-info-row">
                                                                    <div class="profile-info-name">文件过滤条件</div>
                                                                    <div class="profile-info-value">
																		<span class="editable">
																			<div class="profile-info-row">
																				<div class="profile-info-name">文件名</div>
																				<c:if test="${filter.filterType eq 1 }">
																					<div class="profile-info-value">
																						<span class="lbl"><b>通配符</b></span>&nbsp;&nbsp;
																						${filter.filterValue }
																					</div>
                                                                                </c:if>
																				<c:if test="${filter.filterType eq 2 }">
																					<div class="profile-info-value">
																						<span class="lbl"><b>正则表达式</b></span>&nbsp;&nbsp;
																						${filter.filterValue }
																					</div>
                                                                                </c:if>
																			</div>
																			<div class="profile-info-row">
																				<div class="profile-info-name">文件大小</div>
																				<div class="profile-info-value">
																					<span class="lbl"><b>最小</b></span>&nbsp;&nbsp;
																					${ filter.sizeMin}&nbsp;KB
																				</div>
																				<div class="profile-info-value">
																					 <span class="lbl"><b>最大</b></span>&nbsp;&nbsp;&nbsp;
																					 <c:if test="${empty filter.sizeMax }">
                                                                                         无限制
                                                                                     </c:if>
																					 <c:if test="${!empty filter.sizeMax }">
                                                                                         ${ filter.sizeMax}&nbsp;KB
                                                                                     </c:if>
																				</div>
																			</div>
																		</span>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
										</div>
										
										<div class="row">
											<div class="col-sm-12">
												<h6 class="header smaller lighter blue">
													&nbsp;&nbsp;频率设置</h6>
											</div>
										</div>
										<div class="row">
											<div class="table-responsive">
												<div class="row">
													<div class="col-xs-12">
														<div class="widget-main">
															<div class="profile-user-info profile-user-info-striped">
																<div class="profile-info-row"></div>
																<div class="profile-info-row">
																	<div class="profile-info-name" style="padding-top: 13px;">任务类型</div>
																	<div class="profile-info-value">
																		<span class="editable">
																			<c:if test="${vo.taskFreqType eq 1 }">
																				<div class="profile-info-row">
																					<div class="profile-info-name">
																						<span class="lbl">一次性任务</span>
																					</div>
																					<div class="profile-info-value">
																						<c:if test="${ontime.executeType eq 1 }">
																							<span class="lbl">立即发送</span>
																						</c:if>
																						<c:if test="${ontime.executeType eq 2 }">
																							<span class="lbl">手动发送</span> 
																						</c:if>
																						<c:if test="${ontime.executeType eq 3 }">
																							<span class="lbl">定时发送:</span> 
																							<b>${ontime.executeTime}</b>
																						</c:if>
																					</div>
																				</div>
																			</c:if>
																			<c:if test="${vo.taskFreqType eq 2 }">
																				<div class="profile-info-row">
																					<div class="profile-info-name">
																						<span class="lbl">周期性任务</span>
																					</div>
																					<div class="profile-info-value">
																						<c:if test="${period.freq eq 1}">
																								<b><span class="lbl">间隔
																								<fmt:formatNumber type="number" value="${period.intervalVallue/60 }" maxFractionDigits="2"/>&nbsp;分钟&nbsp;(${period.intervalVallue }&nbsp;秒)
																								</span>
																								</b>
																							&nbsp;&nbsp;
                                                                                            <c:if test="${dm.mappingType eq 1}">
																							<span class="lbl">是否结算</span>&nbsp;&nbsp;<b><c:if test="${vo.isSett eq 1 }">是</c:if> <c:if test="${vo.isSett ne 1 }">否</c:if></b>
                                                                                            </c:if>
																						</c:if>
																						<c:if test="${period.freq eq 2}">
																								<span class="lbl">每天</span>
																						</c:if>
																						<c:if test="${period.freq eq 3}">
																								<span class="lbl">每周(${app:ctname("WEEK_TYPE",period.intervalVallue) })</span>&nbsp;&nbsp;&nbsp;
																						</c:if>
																						<c:if test="${period.freq eq 4}">
																								<span class="lbl">每月(${period.intervalVallue })</span>&nbsp;&nbsp;&nbsp; 
																						</c:if>
																							&nbsp;<b>${period.executeTime }</b>
																					</div>
																					<div class="profile-info-row">
																						<div class="profile-info-name">截止时间</div>
																						<div class="profile-info-value">
																							<span class="editable"> 
																								<c:if test="${empty period.cutOffTime }">
																									<span class="lbl">无限制</span> 
																								</c:if>
																								<c:if test="${! empty period.cutOffTime  }">
																									<b>${period.cutOffTime }</b>
																								</c:if>
																							</span>
																						</div>
																					</div>
																				</div> 
																			</c:if>
																		</span>
																	</div>
																</div>
																<div class="profile-info-row">
																	<div class="profile-info-name">数据抽取起始时间</div>
																	<div class="profile-info-value">
																		<span class="editable">
																		<c:if test="${ empty vo.extrStartTime }">无</c:if><c:if test="${ !empty vo.extrStartTime }">${app:fmtDate(vo.extrStartTime)}</c:if>
																		</span>
																	</div>
																</div>
																<c:if test="${ !empty vo.extrEndTime }">
																<div class="profile-info-row">
																	<div class="profile-info-name">数据抽取截止时间</div>
																	<div class="profile-info-value">
																		<span class="editable">
																		${app:fmtDate(vo.extrEndTime)}
																		</span>
																	</div>
																</div>
																</c:if>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
										
										 				
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<div id="tempDiv" style="display: none;">
		<div class="modal-dialog modal-lg" style="width: 1200px;">
			<div class="modal-content" id="tableDiv">
			</div>
		</div>
	</div>
</body>
</html>